package com.httpclient.getDemo.controller;

import com.httpclient.getDemo.service.GetSimpleDemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class GetSimpleDemoController {

    @Autowired
    private GetSimpleDemoService getSimpleDemoService;

    /**
     * httpclient的简单例子
     * get请求无参
     */

    @GetMapping("/getSimpleDemo")
    public void getSimpleDemo(){
        getSimpleDemoService.getSimpleDemo();

    }


    @GetMapping("/getHaveParam")
    public void getHaveParam(String url, Map<String,String> params){
        getSimpleDemoService.getHaveParam(url,params);
    }
}
